﻿using System;

namespace demo2
{
    class ExplicitConversion
    {
        // 显式的类型转换
        static void Main(string[] args)
        {
            double d = 5673.74;
            int i;

            // 强制转换 double 为 int
            i = (int)d;
            Console.WriteLine(i);
            Console.ReadKey();
            // 把不同值的类型转换为字符串类型：
            int i1 = 75;
            float f = 53.005F;
            double d1 = 2345.7652;
            bool b = true;

            Console.WriteLine(i1.ToString());
            Console.WriteLine(f.ToString());
            Console.WriteLine(d1.ToString());
            Console.WriteLine(b.ToString());
            Console.ReadKey();
        }
    }
}
